import VueRouter from 'vue-router'

import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import Newslist from './components/news/Newslist.vue'
import newinfo from './components/news/newinfo.vue'
import photolist from './components/photos/photolist.vue'
import photoinfo from './components/photos/photoinfo.vue'
import goodlist from './components/goodlist/goodlist.vue'
import goodinfo from './components/goodlist/goodinfo.vue'
import gooddesc from './components/goodlist/gooddesc.vue'
import goodcomment from './components/goodlist/goodcomment.vue'


// 3. 创建路由对象
var router = new VueRouter({
  routes: [ // 目前这个路由是空的
    { path: '/', redirect:'/home' },    
    { path: '/home', component: HomeContainer },
    { path: '/member', component: MemberContainer },
    { path: '/shopcar', component: ShopcarContainer },
    { path: '/search', component: SearchContainer },  
    { path: '/home/newslist', component: Newslist }, 
    { path: '/home/newinfo/:id', component: newinfo }, 
    { path: '/home/photolist', component: photolist },   
    { path: '/home/photoinfo/:id', component: photoinfo },   
    { path: '/home/goodlist', component: goodlist }, 
    { path: '/home/goodinfo/:id', component: goodinfo },                   
    { path: '/home/gooddesc/:id', component: gooddesc,name:'gooddesc' },                   
    { path: '/home/goodcomment/:id', component: goodcomment,name:'goodcomment' },                       
    
  ],
  linkActiveClass:'mui-active'//让用户在tabbar中选中的那一项高亮（排他）
})

// 把路由对象暴露出去
export default router